package com.sc.server.member.config;

import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author yuantongqin
 * desc:
 * 2020-08-11
 */
public class CharFilter extends OncePerRequestFilter {

    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        System.out.println("先执行filter，在到servlet");
        response.setCharacterEncoding("UTF-8");
        filterChain.doFilter(request,response);
    }
}
